function showEventForm(){
	$('#eventFormContainer').show();
}

function showVenueForm(){
	//Todo: make default option selected=selected
	$("#submitEventButton").hide();
	
	$('#eventFormContainer').hide();
	$('#venueFormContainer').show();
}

function hideVenueForm(){
	//todo: clear all values in the venue fields
	$("#venueName").val("");
	$("#venueAddress").val("");
	$("#venueDescription").val("");
	$("#venueCapacity").val("");
			
	$('#eventFormContainer').show();
	$("#venueFormContainer").hide();
	$("#submitEventButton").show();
	setCookie("creatingVenueCookie","0");
}

function checkCookie(s){
	var creating = getCookie(s);
	if (creating==1){
		showVenueForm();
	}
	else{
		showEventForm();
	}
}

function getCookie(c_name){
    var i,x,y,ARRcookies=document.cookie.split(";");
    for (i=0;i<ARRcookies.length;i++)
    {
      x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
      y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
      x=x.replace(/^\s+|\s+$/g,"");
      if (x==c_name  && y==1)
        {
        return 1;
        }
      }
    return 0;
}

function setCookie( name, value){
    document.cookie = name+"="+value;
}

$(document).ready(function(){  
    checkCookie("creatingVenueCookie");
    });